<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>main</title>
<jsp:include page="../head.jsp" />
<script type="text/javascript">

	function save(){
		if(trim($("#positionName").val())==""){
			j_tip("职位名称不能为空。", 'error');
			return;
		}
		if (!checkForm(document.getElementById("saveForm"))) {
			return;
		}
		xbox.load("loading");	
		$("#saveForm").ajaxSubmit(function(){
	   		$("#refreshForm").submit();
	    });
	}
	function turnBack(){
	   $("#refreshForm").submit();
	}

</script>

</head>
<body>
<form action="<%=path%>/position/position_save_listAction.action" method="post" id="saveForm">
<table width="98%" align="center" border="0" cellpadding="4" cellspacing="1" bgcolor="#F1F1F1" style="margin-bottom:8px">
  <tr bgcolor="#FFFFFF">
    <td colspan="4" height="16"><span></span></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td width="10%" align="right" bgcolor="#FFFFFF"><span style="color:red;">*</span>职位名称：</td>
    <td width="40%" align="left" bgcolor="#FFFFFF">
              <input maxlength="25" type="text" name="position.positionName" id="positionName" value="${position.positionName}" />
    </td>
    <td width="10%" align="right" bgcolor="#FFFFFF">职位编号：</td>
    <td width="40%" align="left" bgcolor="#FFFFFF">
    			<input maxlength="25" type="text" name="position.positionNo" id="positionNo" value="${position.positionNo}" />
    </td>
  </tr>
   <tr bgcolor="#FFFFFF">
    <td width="10%" align="right" bgcolor="#FFFFFF">职位职责：</td>
    <td width="40%" align="left" bgcolor="#FFFFFF">
    			<input type="text" name="position.positionDuty" value="${position.positionDuty}"  id="positionDuty" />
    </td>
    <td width="10%" align="right" bgcolor="#FFFFFF">所属部门：</td>
    <td width="40%" align="left" bgcolor="#FFFFFF">
    <select name="departmentId" id="departmentId" >
          	<option value="1">默认设置</option>
          	<c:forEach items="${departmentList}" var="dep">
          		<option value="${dep.departmentId}">${dep.departmentName}</option>
          	</c:forEach>
          	</select>
    </td>
   </tr>
  <tr bgcolor="#FFFFFF">
    <td width="10%" align="right" bgcolor="#FFFFFF">备注：</td>
    <td width="90%" colspan="3" align="left" bgcolor="#FFFFFF">
    			<textarea rows="3"  name="position.remark" id="remark">${position.remark}</textarea>
    </td>
  </tr>
  <tr align="right" bgcolor="#F1F1F1">
	<td height="36" colspan="4" align="center">
		<input type='button' class="btn btn-primary" id="btnSave" onclick="save();" value='保存' />
	    &nbsp;<input type='button' class="btn" onclick="turnBack();" value='返回' />
</td>
</tr>
</table>
</form>

<form action="${listUrl}" method="post" style="display: none;" id="refreshForm" name="refreshForm"/>

</body>
</html>
